Telegram Group & Telegram Channel
Вы используете локальные переменные в LINQ и используете let? 👇

Ключевое слово let позволяет вводить временную переменную прямо внутри запроса LINQ — как локальную переменную в цикле.

Разбивайте сложные вычисления на части

Делайте запрос модульнее и чище

Меньше проходов по данным → выше производительность

👉 Простой пример:
csharp


from order in orders
let total = order.Items.Sum(i => i.Price * i.Quantity)
where total > 1000
let categories = order.Items.Select(i => i.Category).Distinct()
select new
{
OrderId = order.Id,
Total = total,
Categories = categories
};

let total = … — вычисляем сумму заказа только один раз

where total > 1000 — фильтруем по готовому значению

let categories = … — собираем уникальные категории



tg-me.com/csharp_1001_notes/675
Create:
Last Update:

Вы используете локальные переменные в LINQ и используете let? 👇

Ключевое слово let позволяет вводить временную переменную прямо внутри запроса LINQ — как локальную переменную в цикле.

Разбивайте сложные вычисления на части

Делайте запрос модульнее и чище

Меньше проходов по данным → выше производительность

👉 Простой пример:
csharp


from order in orders
let total = order.Items.Sum(i => i.Price * i.Quantity)
where total > 1000
let categories = order.Items.Select(i => i.Category).Distinct()
select new
{
OrderId = order.Id,
Total = total,
Categories = categories
};

let total = … — вычисляем сумму заказа только один раз

where total > 1000 — фильтруем по готовому значению

let categories = … — собираем уникальные категории

BY C# 1001 notes




Share with your friend now:
tg-me.com/csharp_1001_notes/675

View MORE
Open in Telegram


C 1001 notes Telegram | DID YOU KNOW?

Date: |

What is Telegram Possible Future Strategies?

Cryptoassets enthusiasts use this application for their trade activities, and they may make donations for this cause.If somehow Telegram do run out of money to sustain themselves they will probably introduce some features that will not hinder the rudimentary principle of Telegram but provide users with enhanced and enriched experience. This could be similar to features where characters can be customized in a game which directly do not affect the in-game strategies but add to the experience.

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

C 1001 notes from it


Telegram C# 1001 notes
FROM USA